import axios from '@/utils/axios';

/* 薪享卡-获取账户额度信息 */
export const getAccountDetail = () => axios.post('/bnd-uaac/advance/findAdvanceDetail');

/* 薪享卡-充值 */
export const rechargeMoney = data => axios.post('/bnd-uaac/advance/addRemittance', data);

/* 薪享卡-批量分配导入人员信息 */
export const batchImportUser = data =>
  axios.post('/bnd-uaac/advance/batch/allocateCard', data, { timeout: 300000 }); // 最长等待5分钟

/* 薪享卡-提交发放清单接口 */
export const submitAllocate = data => axios.post('/bnd-uaac/advance/allocateAmount', data);

/* 福利发放-分配详情接口 */
export const listUaacAdvanceGrantRecordDetail = (data, page) =>
  axios.post(
    `/bnd-uaac/advance/listUaacAdvanceGrantRecordDetail/${page.current}/${page.size}`,
    data
  );
/* 福利发放-分配详title信息 */
export const listUaacAdvanceGrantRecordDetailTotal = data =>
  axios.post(`/bnd-uaac/advance/listUaacAdvanceGrantRecordDetailTotal`, data);

/* 薪享卡-分页模糊查询企业全部人员 */
export const getAllUser = data =>
  axios.post('/bnd-organization/userOrganization/selectStaff', data);

/* 薪享卡-根据用户Ids获取用户数据 */
export const getAllUserByIds = ({ organizationId, ids }) =>
  axios.post(`/bnd-uaac/uaacUser/getUserInfoListByUserIdAndOrganizationId/${organizationId}`, ids);

/* 薪享卡-福利分配管理查询 */
export const getDistributeList = ({ pageNumber, pageSize, ...data }) =>
  axios.post(`/bnd-uaac/advance/listUaacAdvanceGrantRecord/${pageNumber}/${pageSize}`, data);

/* 薪享卡-发放记录 */
export const getDistributeHistoryList = data => axios.post('/bnd-uaac/advance/grantList', data);

/* 薪享卡-导出发放记录 */
export const exportDistributeHistory = data =>
  axios.post('/bnd-uaac/advance/grantListExport', data, {
    responseType: 'blob',
  });

/* 薪享卡-批量导出发放人员记录 */
export const exportDistributeUsers = data =>
  axios.post('/bnd-uaac/advance/exportUaacAdvanceGrantRecordDetail', data, {
    responseType: 'blob',
  });

/* 薪享卡-确认发放 */
export const commitDistribute = data =>
  axios.post('/bnd-uaac/advance/commitAllocateAmount', data, { timeout: 300000 });

/* 薪享卡-取消发放 */
export const cancelDistribute = id => axios.post(`/bnd-uaac/advance/cancelAllocateAmount/${id}`);

/* 薪享卡-生成卡密 */
export const createCardCode = data => axios.post('/bnd-uaac/advance/createCardCode', data);

/* 薪享卡-直接发放卡密 */
export const sendCardCode = data => axios.post('/bnd-uaac/advance/sendCardCode', data);
/* 薪享卡-对账管理列表接口 */
export const getAdvanceBillList = data => axios.post(`/bnd-uaac/advance/getAdvanceBillList`, data);

/* 薪享卡-对账管理导出列表接口 */
export const advanceBillExcelFile = data =>
  axios.post(`/bnd-uaac/advance/company/advanceBillExcelFile`, data, {
    responseType: 'blob',
  });

/* 薪享卡-对账管理详情列表接口 */
export const getAdvanceBillDetailList = data =>
  axios.post(`/bnd-uaac/advance/getAdvanceBillDetailList`, data);

/* 薪享卡-对账详情导出列表接口 */
export const advanceBillDetailExcelFile = data =>
  axios.post(`/bnd-uaac/advance/advanceBillDetailExcelFile`, data, {
    responseType: 'blob',
  });

/* 薪享卡-关联订单列表接口 */
export const getAdvanceOrderList = data =>
  axios.post(`/bnd-uaac/advance/getAdvanceOrderList`, data);

/* 薪享卡-关联订单导出列表接口 */
export const advanceOrderListExcelFile = data =>
  axios.post(`/bnd-uaac/advance/advanceOrderListExcelFile`, data, {
    responseType: 'blob',
  });

/* 薪享卡-回收记录接口 */
export const recycleRecord = data =>
  axios.post(`/bnd-uaac/v1/api/salaryWelfare/page/recycleRecord/dept`, data);

/* 薪享卡-查看回款接口 */
export const getAdvanceMoneyBackList = data =>
  axios.post(`/bnd-uaac/advance/getAdvanceMoneyBackListForEnterprise`, data);

/* 薪享卡-回款详情接口 */
export const getMoneyBackDetail = data =>
  axios.post(`/bnd-uaac/advance/getMoneyBackDetail/${data}`, data);

/* 薪享卡-查看授信记录接口 */
export const queryAdvanceChangeRecord = data =>
  axios.post(`/bnd-uaac/advance/queryAdvanceChangeRecord`, data);

/* 薪享卡-导出授信记录接口 */
export const exportAdvanceChangeRecord = data =>
  axios.post(`/bnd-uaac/advance/exportAdvanceChangeRecord`, data, {
    responseType: 'blob',
  });

/* 薪享卡-批量导入分发人员进度 */
export const getDistributeProgress = () => {};
// axios.post(`/bnd-uaac/advance/exportAdvanceChangeRecord`);
